﻿using Microsoft.AspNetCore.Mvc.Filters;
using ZilLion.Service.Crm.Unities.Config;

namespace ZilLion.Service.WebInfrastructure.Filter
{
    public class ErrorAttribute : ExceptionFilterAttribute
    {
        public override void OnException(ExceptionContext context)
        {
            LogHelper.LogException(context.Exception, "页面", "ZLTProxy");

            //设置为true阻止golbal里面的错误执行
            context.ExceptionHandled = true;
            context.HttpContext.Response.Redirect("/Home/Error");
            base.OnException(context);
        }
    }
}